package com.jiang.jixiang.ui.adapter;

import androidx.annotation.NonNull;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.jiang.jixiang.R;
import com.jiang.jixiang.bean.CountryCode;
import com.ws.universal.tools.newsletter.ColorGenerator;
import com.ws.universal.tools.newsletter.TextDrawable;
import com.ws.universal.tools.utils.StringUtils;

public class CountryAdapter extends BaseQuickAdapter<CountryCode, BaseViewHolder> {
    private TextDrawable.IBuilder mDrawableBuilder = TextDrawable.builder().round();
    private ColorGenerator mColorGenerator = ColorGenerator.MATERIAL;

    public CountryAdapter() {
        super(R.layout.item_country);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder holder, CountryCode bean) {

        holder.setText(R.id.tvItemName, bean.getName());
        holder.setText(R.id.tvItemTel, StringUtils.getString("+", bean.getArea()));
//        TextDrawable drawable = mDrawableBuilder.build(String.valueOf(bean.getName().charAt(0)), mColorGenerator.getColor(bean.getName()));
//        iv_img.setImageDrawable(drawable);
    }
}
